<style>
    .layui-form-item .layui-input-company {width: auto;padding-right: 10px;line-height: 38px;}
</style>
<div class="layuimini-container layuimini-page-anim">
    <div class="layuimini-main">
        <div class="layui-form layuimini-form">


            <div class="layui-form-item">
                <label class="layui-form-label">是否开启</label>
                <div class="layui-input-block">
                    <input type="checkbox" checked="" name="is_active"  value="1"  lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">栏目名称</label>
                <div class="layui-input-block">
                    <input type="text" name="cate_name" lay-verify="required" lay-reqtext="栏目名称不能为空" placeholder="请输入栏目名称"   class="layui-input">
                </div>

            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">排序</label>
                <div class="layui-input-block">
                    <input type="number" name="sort" lay-verify="required" lay-reqtext="排序不能为空" placeholder="请输入排序"   class="layui-input">
                    <tip>从小到大排序</tip>
                </div>

            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" lay-submit lay-filter="setting">确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form','jquery'], function () {
        var form = layui.form
            , layer = layui.layer
            ,$ = layui.jquery;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        //监听提交
        form.on('submit(setting)', function (data) {
            //获取
            ajaxs("/sys/Insertlm",data.field,function(res){
                layer.msg(res["Msg"], function () {
                    layer.closeAll()
                });
            },function(res){
                layer.msg(res["Msg"]);
            })
        });

    });
</script>